<?php
/**
 * 定量计算详情验证器
 */

namespace app\common\validate;

class ComputeDetailValidate extends CommonBaseValidate
{
    protected $rule = [
            'compute_id|计算ID' => 'require',
    'order_id|订单' => 'require',
    'school_id|学校' => 'require',
    'type_id|商品' => 'require',
    'spec_id|规格' => 'require',
    'brand_id|单位' => 'require',
    'num|数量' => 'require',

    ];

    protected $message = [
            'compute_id.required' => '计算ID不能为空',
    'order_id.required' => '订单不能为空',
    'school_id.required' => '学校不能为空',
    'type_id.required' => '商品不能为空',
    'spec_id.required' => '规格不能为空',
    'brand_id.required' => '单位不能为空',
    'num.required' => '数量不能为空',

    ];

    protected $scene = [
        'admin_add'     => ['compute_id', 'order_id', 'school_id', 'type_id', 'spec_id', 'brand_id', 'num', ],
        'admin_edit'    => ['id', 'compute_id', 'order_id', 'school_id', 'type_id', 'spec_id', 'brand_id', 'num', ],
        'admin_del'     => ['id', ],
        'admin_disable' => ['id', ],
        'admin_enable'  => ['id', ],
        'api_add'       => ['compute_id', 'order_id', 'school_id', 'type_id', 'spec_id', 'brand_id', 'num', ],
        'api_info'      => ['id', ],
        'api_edit'      => ['id', 'compute_id', 'order_id', 'school_id', 'type_id', 'spec_id', 'brand_id', 'num', ],
        'api_del'       => ['id', ],
        'api_disable'   => ['id', ],
        'api_enable'    => ['id', ],
    ];
}
